package com.sxdz.controller.service.send

import com.sxdz.controller.mapper.TSendInfoMapper
import com.sxdz.controller.service.BaseService
import com.sxdz.models.TSendInfo
import groovy.transform.CompileStatic
import groovy.transform.TypeChecked
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

/**
 * Created by andy on 2016/8/4.
 */
@Service
@CompileStatic
@TypeChecked
class SendInfoService  implements  ISendInfoService {

    @Autowired
    private  TSendInfoMapper tSendInfoMapper;

    @Override
List<TSendInfo> findObj(Long userId) throws Exception {
        return tSendInfoMapper.selectList(userId);    }

    @Override
    int addSendInfo(TSendInfo sendInfo) {
        tSendInfoMapper.insertSelective(sendInfo);
    }

    @Override
    int deleteSend(Long id) {
        return tSendInfoMapper.deleteByPrimaryKey(id);
    }

    @Override
    int updateIsDefault( Map<String, Object> params) {
        return tSendInfoMapper.updatedefaultSend(params);
    }


    @Override
    int selectCountSend( Map<String, Object> params) {
        return tSendInfoMapper.selectCountByParams(params);
    }

    @Override
    int updateSend(TSendInfo tSendInfo) {
        return tSendInfoMapper.updateByPrimaryKeySelective(tSendInfo);
    }

    @Override
    TSendInfo selectById(Long id) {
        return tSendInfoMapper.selectByPrimaryKey(id);
    }
}
